<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@page import="com.manage.print.SchoolbusArchiveVO"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List list = (List)request.getAttribute("list");
%>
<html> 
	<head> 
	<title>校车信息登记表打印页</title> 
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
	<!--media=print 这个属性可以在打印时有效--> 
	<style media=print> 
		.Noprint{display:none;}<!--用本样式在打印时隐藏非打印项目--> 
		.PageNext{page-break-after: always;}<!--控制分页-->
	</style>

	<style>
		.style_tab_head 
		{ 
		font-family: "仿宋_GB2312"; 
		font-size: 22pt; 
		}
		.forcePage
		{
		page-break-after : always;
		}
		.style_td 
		{ 
		border-bottom: 1 solid #000000; 
		border-left: 1 solid #000000; 
		border-right: 0 solid #ffffff; 
		border-top: 0 solid #ffffff;
		text-align: center;
		height : 30px;
		}
		.style_td_unbottom
		{ 
		border-left: 1 solid #000000; 
		border-right: 0 solid #ffffff; 
		border-top: 0 solid #ffffff;
		text-align: center;
		height : 30px;
		}
		.style_td2
		{ 
		border-bottom: 1 solid #000000; 
		border-left: 1 solid #000000; 
		border-right: 0 solid #ffffff; 
		border-top: 0 solid #ffffff;
		text-align: center;
		height : 60px;
		}
		.style_tab 
		{ 
		border-color: #000000 #000000 #000000 #000000; 
		border-style: solid; 
		border-top-width: 2px; 
		border-right-width: 2px; 
		border-bottom-width: 1px; 
		border-left-width: 1px; 
		}
		.NOPRINT { 
		font-family: "宋体"; 
		font-size: 9pt; 
		}
	</style>
	</head>
	
	<body>
		<center class="Noprint"> 
			<p> 
				<input type=button value=返回 onclick="window.history.back()"> 
			</p> 
		</center>
		<%
		for (int i=0; null!=list && i<list.size(); i++) {
			SchoolbusArchiveVO vo = (SchoolbusArchiveVO)list.get(i);
			if (i!=0) {
		%>
		<div class="forcePage">&nbsp;</div>
		<%
			}
		%>
		<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0">
			<tr>
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td> 
			</tr>
			<tr>
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td> 
			</tr>
			<tr>
				<td colspan="3" align="center" class="style_tab_head">校  车  信  息  登  记  表</td> 
			</tr>
			<tr>
				<%
					String squadron = "&nbsp;";
					if ( vo.getSquadron()!=null && !"".equals(vo.getSquadron())) {
						squadron = vo.getSquadron();
					}
				%>
				<td width="35%">&nbsp;</td> 
				<td width="35%">&nbsp;</td> 
				<td width="30%"><%=squadron%></td>
			</tr>
			<tr> 
				<td width="29%">&nbsp;</td> 
				<td width="28%">&nbsp;</td> 
				<td width="43%">&nbsp;</td>
			</tr> 
			<tr>
				<td colspan="3">
					<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="style_tab"> 
						<tr>
							<%
								String platenumber = "&nbsp;";
								if ( vo.getPlatenumber()!=null && !"".equals(vo.getPlatenumber())) {
									platenumber = vo.getPlatenumber();
								}
							%>
							<td width="20%" class="style_td" colspan="2">车辆号牌</td>
							<td width="20%" class="style_td" colspan="2"><%=platenumber%></td>
							<td width="60%" class="style_td" rowspan="11" colspan="6">贴车辆照片处</td>
						</tr> 
						<tr>
							<%
								String platetype = "&nbsp;";
								if ( vo.getPlatetype()!=null && !"".equals(vo.getPlatetype())) {
									platetype = vo.getPlatetype();
								}
							%>
							<td width="20%" class="style_td" colspan="2">品牌型号</td>
							<td width="20%" class="style_td"><%=platetype%></td>
						</tr>
						<tr>
							<%
								String number = "&nbsp;";
								if ( vo.getNumber()!=null && !"".equals(vo.getNumber())) {
									number = vo.getNumber();
								}
							%>
							<td width="20%" class="style_td" colspan="2">核定人数</td>
							<td width="20%" class="style_td"><%=number%> 人</td>
						</tr>
						<tr>
							<%
								String drivername = "&nbsp;";
								if ( vo.getDrivername()!=null && !"".equals(vo.getDrivername())) {
									drivername = vo.getDrivername();
								}
							%>
							<td width="10%" class="style_td" rowspan="4">驾<br/>驶<br/>员</td>
							<td width="10%" class="style_td">姓  名</td>
							<td width="20%" class="style_td"><%=drivername%></td>
						</tr>
						<tr>
							<%
								String driveridcard = "&nbsp;";
								if ( vo.getDriveridcard()!=null && !"".equals(vo.getDriveridcard())) {
									driveridcard = vo.getDriveridcard();
								}
							%>
							<td width="10%" class="style_td">证  号</td>
							<td width="20%" class="style_td"><%=driveridcard%></td>
						</tr>
						<tr>
							<%
								String driverlevel = "&nbsp;";
								if ( vo.getDriverlevel()!=null && !"".equals(vo.getDriverlevel())) {
									driverlevel = vo.getDriverlevel();
								}
							%>
							<td width="10%" class="style_td">准  驾</td>
							<td width="20%" class="style_td"><%=driverlevel%></td>
						</tr>
						<tr>
							<%
								String driverphone = "&nbsp;";
								if ( vo.getDriverphone()!=null && !"".equals(vo.getDriverphone())) {
									driverphone = vo.getDriverphone();
								}
							%>
							<td width="10%" class="style_td">电  话</td>
							<td width="20%" class="style_td"><%=driverphone%></td>
						</tr>
						<tr>
							<%
								String owername = "&nbsp;";
								if ( vo.getOwername()!=null && !"".equals(vo.getOwername())) {
									owername = vo.getOwername();
								}
							%>
							<td width="10%" class="style_td" rowspan="4">车<br/>辆<br/>所<br/>有<br/>人</td>
							<td width="10%" class="style_td">姓  名</td>
							<td width="20%" class="style_td"><%=owername%></td>
						</tr>
						<tr>
							<%
								String owerphone = "&nbsp;";
								if ( vo.getOwerphone()!=null && !"".equals(vo.getOwerphone())) {
									owerphone = vo.getOwerphone();
								}
							%>
							<td width="10%" class="style_td">电  话</td>
							<td width="20%" class="style_td"><%=owerphone%></td>
						</tr>
						<tr>
							<%
								String oweraddress = "&nbsp;";
								if ( vo.getOweraddress()!=null && !"".equals(vo.getOweraddress())) {
									oweraddress = vo.getOweraddress();
								}
							%>
							<td width="10%" class="style_td">居住地</td>
							<td width="20%" class="style_td"><%=oweraddress%></td>
						</tr>
						<tr>
							<%
								String oweridcard = "&nbsp;";
								if ( vo.getOweridcard()!=null && !"".equals(vo.getOweridcard())) {
									oweridcard = vo.getOweridcard();
								}
							%>
							<td width="10%" class="style_td">身份证</td>
							<td width="20%" class="style_td"><%=oweridcard%></td>
						</tr>
						<tr>
							<%
								String schoolname = "&nbsp;";
								if ( vo.getSchoolname()!=null && !"".equals(vo.getSchoolname())) {
									schoolname = vo.getSchoolname();
								}
								String isMHQ = "○";
								String isAQC = "○";
								String isSJP = "○";
								if ( vo.getSecurityprotection()!=null && !"".equals(vo.getSecurityprotection())) {
									if (vo.getSecurityprotection().contains("1") ) isMHQ = "⊙";
									if (vo.getSecurityprotection().contains("2") ) isAQC = "⊙";
									if (vo.getSecurityprotection().contains("3") ) isSJP = "⊙";
								}
							%>
							<td width="20%" class="style_td" rowspan="2" colspan="2">服务学校</td>
							<td width="20%" class="style_td" rowspan="2" colspan="2"><%=schoolname%></td>
							<td width="20%" class="style_td" rowspan="2" colspan="2">安全防护</td>
							<td width="40%" class="style_td_unbottom" colspan="4"><%=isMHQ%> 灭火器   <%=isAQC%> 安全锤   <%=isSJP%> 三角牌</td>
						</tr>
						<tr> 
							<td width="40%" class="style_td" colspan="4" style="text-align: left;">其它：</td>
						</tr>
						<tr>
							<%
								String businessarea = "&nbsp;";
								if ( vo.getBusinessarea()!=null && !"".equals(vo.getBusinessarea())) {
									businessarea = vo.getBusinessarea();
								}
								String businesstime = "&nbsp;";
								if ( vo.getBusinesstime()!=null && !"".equals(vo.getBusinesstime())) {
									businesstime = vo.getBusinesstime();
								}
							%>
							<td width="20%" class="style_td2" colspan="2">运营区域</td>
							<td width="20%" class="style_td2" colspan="2"><%=businessarea%></td>
							<td width="20%" class="style_td2" colspan="2">运营时间</td>
							<td width="40%" class="style_td2" colspan="4"><%=businesstime%></td>
						</tr>
						<tr>
							<%
								String forceinsurance = "&nbsp;";
								if ( vo.getForceinsurance()!=null && !"".equals(vo.getForceinsurance())) {
									forceinsurance = vo.getForceinsurance();
								}
								String yearlyinspection = "&nbsp;";
								if ( vo.getYearlyinspection()!=null && !"".equals(vo.getYearlyinspection())) {
									yearlyinspection = vo.getYearlyinspection();
								}
							%>
							<td width="20%" class="style_td" rowspan="3" colspan="2">车辆年检</td>
							<td width="20%" class="style_td" colspan="2"><%=yearlyinspection%></td>
							<td width="20%" class="style_td" rowspan="3" colspan="2">交强险</td>
							<td width="40%" class="style_td" colspan="4"><%=forceinsurance%></td>
						</tr>
						<tr> 
							<td width="20%" class="style_td" colspan="2">&nbsp;</td>
							<td width="40%" class="style_td" colspan="4">&nbsp;</td>
						</tr>
						<tr> 
							<td width="20%" class="style_td" colspan="2">&nbsp;</td>
							<td width="40%" class="style_td" colspan="4">&nbsp;</td>
						</tr>
					</table>
				</td> 
			</tr> 
		</table>
		<%
		}
		%>
	</body> 
</html>
<script language="javascript">
	var hkey_root="HKEY_CURRENT_USER" ; 
	var hkey_path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\"; 
	var hkey_key;
	function doPrint() {    
		//直接调用WebBrowser的打印，要打印预览的话是ExecWB(7,1) 直接打印ExecWB(6,6)
     	document.all.WebBrowser.ExecWB(6,6); 
	} 
	//设置纸张方向 
	function setupLandscape() { 
		try{ 
			var wsShell= new ActiveXObject("WScript.Shell"); 
			//打印页面的Menubar必须可见，此操作类似按键盘上的Alt+F+U也就是 调出页面设置对话框 
			wsShell.sendKeys('%fu'); 
			//此操作类似按键盘上的Alt+A也就是 设置横向打印 
			wsShell.sendKeys('%a');
			//此操作类似按键盘上的Alt+O也就是 设置竖向打印 
			//wsShell.sendKeys('%o'); 
			//此操作类似按键盘上的回车 页面设置对话框的默认焦点在 确定上 所以直接确定 
			wsShell.sendKeys('{ENTER}'); 
		} 
		catch(e){} 
	} 
	//设置默认的页眉页脚 
	function setupPage() { 
		try{ 
		var RegWsh = new ActiveXObject("WScript.Shell"); 
			hkey_key="header" 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"") 
			hkey_key="footer" 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"&b") //去掉了&u 因为我不想显示当前打印页的网址 
			hkey_key="margin_bottom"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); //0.39相当于把页面设置里面的边距设置为10 
			hkey_key="margin_left"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); 
			hkey_key="margin_right"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); 
			hkey_key="margin_top"; 
			RegWsh.RegWrite(hkey_root+hkey_path+hkey_key,"0.39"); 
		} 
		catch(e){} 
	} 
	setTimeout("setupLandscape()",1000); 
	setTimeout("setupPage()",2000); 
	setTimeout("doPrint()",3000); 
</script>